package models

import "sale-admin/internal/define"

// MaGoodsInfo [...]
type MaGoodsInfo struct {
	ID                 string  `gorm:"index:ma_goods_info_ibfk_2,type:btree;column:id;type:bigint;not null;comment:设备权限ID"  json:"id" json_old:"ID"`
	MerchantID         string  `gorm:"column:merchant_id;type:bigint;not null;comment:商户id" json:"merchant_id" json_old:"ID"`
	GoodsID            string  `gorm:"index:GoodsID,type:btree;autoIncrement:true;primaryKey;unique;column:goods_id;type:bigint;not null;comment:商品ID"  json:"goods_id" json_old:"GoodsID"`
	ClassID            string  `gorm:"column:class_id;type:int;default:0;comment:类目ID"  json:"class_id" json_old:"ClassID"`
	Price              float64 `gorm:"column:price;type:decimal(10,2) unsigned;default:0.00;comment:商品价格"  json:"price" json_old:"Price"`
	GoodsName1         string  `gorm:"column:goods_name1;type:varchar(255);not null;comment:商品名称1"  json:"goods_name1" json_old:"GoodsName1"`
	GoodsDescription1  string  `gorm:"column:goods_description1;type:varchar(4096);default:null;comment:商品描述1"  json:"goods_description1" json_old:"GoodsDescription1"`
	GoodsImage         string  `gorm:"column:goods_image;type:blob;default:null;comment:商品图片地址"  json:"goods_image" json_old:"GoodsImage"`
	GoodsStatus        uint    `gorm:"column:goods_status;type:int unsigned;not null;default:0;comment:商品状态（0-上架 1-缺货 2-下架）"  json:"goods_status" json_old:"GoodsStatus"`
	TotalSales         int     `gorm:"column:total_sales;type:int(32) unsigned zerofill;not null;default:00000000000000000000000000000000"  json:"total_sales" json_old:"TotalSales"`
	GoodsCode          string  `gorm:"column:goods_code;type:varchar(255);default:null;comment:国标编码"  json:"goods_code" json_old:"GoodsCode"`
	UseRC              uint    `gorm:"column:use_rc;type:int unsigned;default:0;comment:使用兑换码支付（0-不使用，1-使用）"  json:"use_rc" json_old:"UseRC"`
	GoodsName2         string  `gorm:"column:goods_name2;type:varchar(255);default:null;comment:商品名称2"  json:"goods_name2" json_old:"GoodsName2"`
	GoodsDescription2  string  `gorm:"column:goods_description2;type:varchar(4096);default:null;comment:商品描述2"  json:"goods_description2" json_old:"GoodsDescription2"`
	GoodsName3         string  `gorm:"column:goods_name3;type:varchar(255);default:null;comment:商品名称3"  json:"goods_name3" json_old:"GoodsName3"`
	GoodsDescription3  string  `gorm:"column:goods_description3;type:varchar(4096);default:null;comment:商品描述3"  json:"goods_description3" json_old:"GoodsDescription3"`
	Deleted            int     `gorm:"column:deleted;type:tinyint(1);not null;default:0;comment:软删除 0正常 1删除"  json:"deleted" json_old:"Deleted"`
	CodeImage          string  `gorm:"column:code_image;type:varchar(200);default:null"  json:"code_image" json_old:"CodeImage"`
	IsAuth             int     `gorm:"column:is_auth;type:tinyint(1);not null;default:0;comment:是否是正版授权 0不是 1是"  json:"is_auth" json_old:"IsAuth"`
	Price1             float64 `gorm:"column:price1;type:decimal(10,2);default:null;comment:下划线价格"  json:"price1" json_old:"Price1"`
	GoodsDetail        string  `gorm:"column:goods_detail;type:text;default:null;comment:商品详情"  json:"goods_detail" json_old:"GoodsDetail"`
	GoodsVoice         string  `gorm:"column:goods_voice;type:text;comment:商品语音属性"  json:"goods_voice" json_old:"GoodsVoice"`
	ShowTag            string  `gorm:"column:show_tag;type:varchar(256);default:null;comment:展示标签"  json:"show_tag" json_old:"ShowTag"`
	GoodsType          int     `gorm:"column:goods_type;type:int;default:1;comment:商品类别:1 实物商品 2导流商品 3虚拟类商品 4积分商品5优惠商品6零元购商品8线上活动商品"  json:"goods_type" json_old:"GoodsType"`
	Spring             string  `gorm:"column:spring;type:varchar(255);default:null;comment:弹簧规格"  json:"spring" json_old:"Spring"`
	ExternalProductID  string  `gorm:"column:external_product_id;type:varchar(50);not null;comment:外部商品ID" json:"external_product_id"`
	DeductionLimit     float64 `gorm:"column:deduction_limit;type:decimal(10,2);unsigned;default:0.00;not null;comment:抵扣上限" json:"deduction_limit"`
	Points             float64 `gorm:"column:points;type:decimal(10,2) unsigned;default:0.00;comment:抵扣积分"  json:"points" json_old:"Points"`
	PointsSupport      int     `gorm:"column:points_support;type:tinyint(1);not null;default:0;comment:是否支持现金抵扣积分,0关1开"  json:"points_support" json_old:"PointsSupport"`
	VoiceKeywords      string  `gorm:"column:voice_keywords;type:varchar(200);comment:商品语音关键词"  json:"voice_keywords" json_old:"VoiceKeywords"`
	Recommend          int     `gorm:"column:recommend;type:tinyint(1);default:2;comment:首页推荐1推荐2不推荐"  json:"recommend" json_old:"Recommend"`
	RecommendImage     string  `gorm:"column:recommend_image;type:varchar(255);comment:推荐图"  json:"recommend_image" json_old:"RecommendImage"`
	AdImage            string  `gorm:"column:ad_image;type:varchar(255);comment:商品广告推荐图"  json:"ad_image" json_old:"AdImage"`
	CornerLabelID      string  `gorm:"column:corner_label_id;type:varchar(20);comment:角标ID"  json:"corner_label_id" json_old:"CornerLabelID"`
	TagCode            string  `gorm:"column:tag_code;type:varchar(50);default:'';comment:商品编码"  json:"tag_code" json_old:"TagCode"`
	PurchaseType       int     `gorm:"column:purchase_type;type:tinyint(1);default:1;comment:购买配置[1直接领取2小程序领取]"  json:"purchase_type" json_old:"PurchaseType"`
	ReviewPoints       int     `json:"review_points" gorm:"column:review_points;type:int;size:32;default:0;comment:评测奖励积分"`
	ExpressFeeTemplate string  `json:"express_fee_template" gorm:"column:express_fee_template;type:int;size:64;index:idx_express_fee_template;comment:运费模版"`

	// 商品导流配置
	GoodsGuideType   define.GoodsGuideType `json:"goods_guide_type" gorm:"column:goods_guide_type;type:varchar(50);default:'';comment:导流类型[QR二维码 ShareCode口令]"`
	GoodsGuideURL    string                `json:"goods_guide_url" gorm:"column:goods_guide_url;type:text;comment:导流URL"`
	ShareCodeType    define.ShareCodeType  `json:"share_code_type" gorm:"column:share_code_type;type:varchar(50);default:'';comment:口令导流类型[TaoBao\DouYin\JD\XiaoHongShu]"`
	ShareCode        string                `json:"share_code" gorm:"column:share_code;type:text;comment:导流分享码"`
	GoodsGuideNotice string                `json:"goods_guide_notice" gorm:"column:goods_guide_notice;type:text;comment:导流提示 须知"`
}

// TableName get sql table name.获取数据库表名
func (m MaGoodsInfo) TableName() string {
	return "ma_goods_info"
}

// 模式自动注册
func init() {
	Models = append(Models, &MaGoodsInfo{})
}
